﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace NCS.DeviceManager.Models.Entities
{
    public class BaseEntity
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        [Required, DefaultValue(1)]
        public int CreatedBy { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedDate { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        [Required, DefaultValue(1)]
        public int LastUpdatedBy { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime LastUpdatedDate { get; set; }
        /// <summary>
        /// 是否启用
        /// </summary>
        [Required, DefaultValue(true)]
        public bool IsActive { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        [Required, DefaultValue(false)] public bool IsDeleted { get; set; }
    }
}
